<?php

class Damages_Methods_Data_Attachments {

  /**
   *
   * @var Damages_Methods_Data_Attachment 
   */
  public $waybill;

  /**
   *
   * @var Damages_Methods_Data_Attachment 
   */
  public $protocol;

  /**
   *
   * @var Damages_Methods_Data_Attachment[] 
   */
  public $photos = array();

  /**
   *
   * @var Damages_Methods_Data_Attachment[]
   */
  public $additional = array();

  public function addAttachmentData(DamagesAttachments $attachment) {
    switch ($attachment->getDictAttachmentTypes()->getCode()) {
      case DamagesDictAttachmentTypes::CODE_LETTER:
        $this->waybill = new Damages_Methods_Data_Attachment($attachment);
        break;
      case DamagesDictAttachmentTypes::CODE_PROTOCOL:
        $this->protocol = new Damages_Methods_Data_Attachment($attachment);
        break;
      case DamagesDictAttachmentTypes::CODE_PHOTO:
        $this->photos[] = new Damages_Methods_Data_Attachment($attachment);
        break;
      case DamagesDictAttachmentTypes::CODE_ADDITIONAL:
        $this->additional[] = new Damages_Methods_Data_Attachment($attachment);
        break;
      default:
        break;
    }
  }

}